import request from '@/utils/request'

export const teacherService = {
    // 上传证件
    uploadDocument(file) {
        const formData = new FormData()
        formData.append('file', file)
        return request.post('/teacher/upload-document', formData, {
            headers: {
                'Content-Type': 'multipart/form-data'
            }
        })
    },

    // 提交教师认证信息
    submitTeacherInfo(data) {
        return request.post('/teacher/submit-info', data)
    },

    // 获取教师认证信息
    getTeacherInfo() {
        return request.get('/teacher/info')
    },

    // 获取指定教师的认证信息
    getTeacherInfoById(userId) {
        return request.get(`/teacher/info/${userId}`)
    },

    // 获取所有教师认证信息
    getAllTeacherInfo() {
        return request.get('/teacher/all')
    },

    // 更新教师认证信息
    updateTeacherInfo(data) {
        return request.put('/teacher/update', data)
    }
} 